import router from "./index"
import { getUserId,removeUserId} from "@/utils/usecookie";
router.beforeEach((to, from, next) => {

if(getUserId()){
    next()
    if(to.fullPath=="/login"){
        removeUserId()
        next()
    }
}else 
if(to.fullPath=="/login"||to.fullPath=="/register"){
    next()
}else{
    next({name:"Login"})
}
})